package com.moto.service.impl;

import com.moto.Vo.BolgFindAllVO;
import com.moto.entity.Bolg;
import com.moto.mapper.BolgMapper;
import com.moto.service.IBolgService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
import org.springframework.web.multipart.MultipartFile;

import javax.annotation.Resource;
import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author zyz
 * @since 2023-08-29
 */
@Service
public class BolgServiceImpl extends ServiceImpl<BolgMapper, Bolg> implements IBolgService {

    @Resource
    private BolgMapper bolgMapper;

    /**
     * 热门文章
     * @return
     */
    @Override
    public List<BolgFindAllVO> findHotBolg() {
        return bolgMapper.findHotBolg();
    }

    @Override
    public Long updataReadCountAsync() {
        return null;
    }

    /**
     * 发布文章
     * @param bolg
     * @return
     */
    @Override
    public void publish(Bolg bolg) {
        bolgMapper.publish(bolg);
    }

    /**
     * 增加浏览量
     * @param bolgId
     */
    @Override
    public int incrementViews(Integer bolgId) {
        return bolgMapper.incrementViews(bolgId);
    }

    @Override
    public int like(Integer bolgId) {
        return bolgMapper.like(bolgId);
    }

    @Override
    public int collect(Integer bolgId) {
        return bolgMapper.collect(bolgId);
    }

    @Override
    public List<BolgFindAllVO> findByIdBolg(int id) {
        return bolgMapper.findByIdBolg(id);
    }

    @Override
    public List<BolgFindAllVO> findAllBolg() {
        return bolgMapper.findAllBolg();
    }


}
